package work9Y11D;

import java.util.Scanner;

public class HomeWork03 {
	public static void main(String[] args) {
		Scanner input = new Scanner (System.in);
		System.out.println("请输入菱形的行数:");
		int rows = input.nextInt();
		while(rows%2==0){
		System.out.println("请输入奇数:");
		rows = input.nextInt();
		}
		int n=(rows+1)/2;
		for(int i=1;i<=n;i++) {
		for(int j= 1;j <= n - i; j++) {
		System.out.print(" ");
		}
		for (int k = 1; k <=2*i-1; k++) {
		System.out.print("*");
		}
		System.out.println();
		}
		for (int i =n-1; i>0; i--) {
		for (int n1 = i; n1 <rows-i; n1++) {
		System.out.print(" ");
		}
		for (int j = 1; j <=2*i-1; j++) {
		System.out.print("*");
		}
		System.out.print("\n");
	}
}

}
